-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix React 19 compatibility issues with @floating-ui/react #5787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5787 +/- ##
==========================================
- Coverage 97.20% 97.19% -0.01%
==========================================
Files 30 30
Lines 3393 3391 -2
Branches 1436 1421 -15
==========================================
- Hits 3298 3296 -2
Misses 95 95 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@balajis-qb can you review? |
@claude Review this PR |
Claude finished @martijnrusschen's task —— View job PR Review: React 19 Compatibility FixTodo List
✅ Overall AssessmentThis is a solid fix for React 19 compatibility issues. The changes are focused, well-reasoned, and address the core problems described in the PR. 🔍 Detailed ReviewDependency Updates ✅
TypeScript Fixes ✅
- const arrowRef: React.RefObject<HTMLElement | null> = useRef(null);
+ const arrowRef = useRef<SVGSVGElement>(null);
Additional improvements in
Component Modernization ✅
Development Environment Fix ✅
alias: {
// Ensure single React instance to avoid "Invalid hook call" errors
react: path.resolve(__dirname, "node_modules/react"),
"react-dom": path.resolve(__dirname, "node_modules/react-dom"),
}
🤔 Coverage NoteCodecov shows 1 missing line in
📝 Minor Suggestions
✨ What I Like
🎯 ConclusionStatus: Ready to merge ✅ This PR successfully resolves React 19 compatibility issues with focused, high-quality changes. The dependency update, TypeScript fixes, and development environment improvements all work together to solve the "Invalid hook call" errors while modernizing the codebase. |
Summary
• Updated @floating-ui/react from 0.27.12 to 0.27.15 to resolve React 19 compatibility issues
• Fixed TypeScript errors in floating UI integration
• Resolved "Invalid hook call" errors in development environment
Changes Made
Core Library Updates
Code Fixes
Development Environment
Problem Solved
The main issue was React 19's new ref callback cleanup function feature wasn't supported by @floating-ui/react 0.27.12. This caused:
Testing
Technical Details
The @floating-ui/react 0.27.15 update includes fixes for React 19's useMergeRefs hook compatibility, specifically addressing the new cleanup function support for ref callbacks.
The vite.config.js changes ensure consistent React resolution during development to prevent the common "multiple React instances" issue.